<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    console.log(null == undefined);

    console.log(Number.MAX_VALUE);

    console.log(5/0);

    // let num = prompt("请输入一个数字");
    // console.log(typeof num);
    // console.log(typeof(num));
    // console.log(num/0 == NaN);
    // if (isNaN(num)) {
    //     console.log("不是数字");
    // } else {
    //     console.log(Number(num) + 100);
    // }

    console.log(Number(undefined));
    console.log(Number(null));
    console.log(Number(false));
    console.log(Number(""));
    console.log(Number("0000111"));
    console.log(Number("undefined"));

    console.log(parseInt("0101", 10));
    console.log(parseInt("0101abc"));
    console.log(parseInt("a0101abc"));

    let s = prompt("请输入输入框的提示内容");
    let type = "text";
    let className = "form-control input-sm";
    console.log("a" + "b");
    // let inp = "<input type=\"text\" className=\"form-control input-sm\" placeholder=\"" + s + "\">";
    // let inp = '<input type="' + type + '" class="' + className + '" placeholder="' + s + '">';
    // let inp = '<input type="';
    // inp += type;
    // inp += '" class="';
    // inp += className;
    // inp += '" placeholder="';
    // inp += s;
    // inp += '">';
    //字符串模板允许写多行
    // let inp = `
    //     <input type="${type}" class="${className}" placeholder="${s}">
    // `;
    let inp = `
        <table class="table table-hover table-bordered">
                <caption>Optional table caption.</caption>
                <thead>
                <tr>
                    <th>#</th>
                    <th>First Name</th>
                    <th>Last Name</th>
                    <th>Username</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <th scope="row">1</th>
                    <td>Mark</td>
                    <td>Otto</td>
                    <td>@mdo</td>
                </tr>
                <tr>
                    <th scope="row">2</th>
                    <td>Jacob</td>
                    <td>Thornton</td>
                    <td>@fat</td>
                </tr>
                <tr>
                    <th scope="row">3</th>
                    <td>Larry</td>
                    <td>the Bird</td>
                    <td>@twitter</td>
                </tr>
                </tbody>
            </table>
    `;
    document.write(inp);

    let ss = "haha";
    console.log(ss.concat(s).length);
    console.log(ss.concat(s, type, className));

    let num = 10;
    console.log(num.toString()); // "10"
    console.log(num.toString(2)); // "1010"
    console.log(num.toString(8)); // "12"
    console.log(num.toString(10)); // "10"
    console.log(num.toString(16)); // "a"
    console.log(num + 1 + ""); //11
    console.log("" + num + 1); //101

    console.log(typeof String(num));
    console.log(typeof String(undefined));
    console.log(String(undefined));

    let sa1 = Symbol("a");
    let sa2 = Symbol("a");
    //比较内容
    console.log(sa1 == sa2);
    //比较类型和内容，本质就是比较内存地址
    console.log(sa1 === sa2);

    let sage = Symbol('age');
    //简写，字面量写法
    let obj = {
        _name: "haha",
        [Symbol('age')]: 18
    }
    //标准写法
    let obj1 = new Object({
        _name: "haha",
        [Symbol('age')]: 18
    });
    let obj2 = new Object({
        _name: "haha",
        sage: 18
    });
    console.log(obj2.sage);
    console.log(obj === obj1);
    //name属性不允许被其它地方使用
    obj.name = "张三";
    console.log(obj.name);
    console.log(obj.sage);
    // Object.defineProperty()
    //通过Number()构造方法，创建了一个Number的引用类型
    let num1 = new Number(100);

    console.log(typeof num1);
    console.log(num1);

    obj.study = "javascript";
    console.log(obj.study);

    function t2(newobj) {
        console.log(obj.study);
        newobj.a = "a";
    }

    t2(obj);
    console.log(obj.a);
</script>
</body>
</html>